
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<link type="text/css" rel="stylesheet" href="__PUBLIC__/Admin/css/style.css" />
	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/menu.js"></script>
	<style type="text/css">
		table{
			width: 100%;
			text-align: center;
			margin-left: auto;
			margin-right: auto;
		}
		table th{
			background-color: #11B6B6;
			color: white;
			font-family: "微软雅黑";
		}
		#pageinfo{
			margin: 15px auto;
			text-align: center;
		}		
	</style>
</head>
<body>

	<div class="right-nav">
          <ul>
              <li><img src="__PUBLIC__/Admin/images/home.png"></li>
                <li style="margin-left:25px;">您当前的位置：</li>
                <li><a href="__MODULE__/Index/index">内容管理</a></li>
                <li>></li>
                <li><a href="__MODULE__/Complain/index">用户投诉处理</a></li>
            </ul>
     </div>
	<form name="demo" method="post">
	<p id="pageinfo">
	<input id="Button1" type="button" value="全选" onclick="allSelect();" />
	<input id="Button1" type="button" value="反选" onclick="otherSelect();" />
	<input type="button" value="处理选中" onclick="handleAction()">
	<input type="button" value="删除选中" onclick="deleteAction()">
	按举报人搜索:<input type="text" name="keyword" />
	<input type="button" value="搜索" onclick="selectAction()">
	</p>
	<p id="pageinfo">{$pageinfo}</p>
	<table cellspacing="1" cellpadding="2" id="list-table">
		<tr>
			<th>选择</th>
			<th>编号</th>
			<th>被举报的信息内容简介</th>
			<th>被举报的信息详情</th>
			<th>举报人联系方式</th>
			<th>举报原因</th>
			<th>举报人</th>
			<th>处理</th>
			<th>删除</th>
		</tr>
		<?php foreach($coms as $com):?>
		<tr>
			<td><input type="checkbox" name='id[]' value='<?php echo $com['com_id'];?>' /></td>
			<td><?php echo $com['com_id'];?></td>
			<td width=30%><?php echo mb_substr($com['info_content'], 0, 120, 'utf-8'),'...';?></td>
			<td><a href='__APP__<?php echo '/Home/Message/infodetail/info_id/'.$com['info_id'];?>' target='_blank'>查看信息详情</a></td>
			<td><?php echo $com['tel'];?></td>
			<td width=30%><?php echo $com['reason'];?></td>
			<td><?php echo $com['user_name'];?></td>
			<td><?php echo $com['if_dispose']?'已处理':'<a href="__MODULE__/Complain/handle/id/'.$com['com_id'].'/p/'.$p.'/keyword/'.$keyword.'" onclick="JavaScript:return confirm(\'确认要处理吗?\')">处理</a>';?></td>
			<td><a href="__MODULE__/Complain/delete/id/<?php echo $com['com_id'].'/p/'.$p.'/keyword/'.$keyword;?>" onclick="JavaScript:return confirm('确认要删除吗?')">删除</a></td>
		</tr>
		<?php endforeach;?>
	</table>
	<p id="pageinfo">{$pageinfo}</p>
	</form>
	<script>
	function deleteAction(){
	    document.demo.action="__MODULE__/Complain/delete/p/<?php echo $p;?>/keyword/<?php echo $keyword;?>";
	    document.demo.submit();
	}
	function handleAction(){
	    document.demo.action="__MODULE__/Complain/handle/p/<?php echo $p;?>/keyword/<?php echo $keyword;?>";
	    document.demo.submit();
	}
	function allSelect() {
        if ($(":checkbox").attr("checked") != "checked") {
            $(":checkbox").attr("checked", "checked");
        }
        else {
            $(":checkbox").removeAttr("checked");
        }
    }
	function otherSelect() {
        $(":checkbox").each(function () {
            if ($(this).attr("checked") == "checked") {
                $(this).removeAttr("checked");
            }
            else {
                $(this).attr("checked", "checked");
            }
        });
    }
	function selectAction(){
	    document.demo.action="__MODULE__/Complain/index";
	    document.demo.submit();
	}
	</script>
</body>
</html>